package com.ds.infra.rpc.core.protocol;

/**
 * 作用：构建RPC协议，用于序列化和反序列化RPC请求和响应
 *
 * @author WeiShaoying
 */
public class ProtocolBuilder {
    public static RpcProtocol<RpcRequest> buildProtocol(RpcRequest request) {
        RpcProtocol<RpcRequest> protocol = new RpcProtocol<>();
        // protocol.setHeader(new byte[4]); // 魔数等头部信息
        protocol.setBody(request);
        return protocol;
    }
}
